Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API #3

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Add API #3

wants to merge 2 commits into from

Conversation

quangkeu95
Copy link
Collaborator

No description provided.

@@ -48,5 +49,8 @@ func cmdMain(ctx *cli.Context) error {
kyberSc.GetStake(uint64(1), "mike")
log.Println("staking done")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove above code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From line 43 to 50 or just line 50 only?

defer self.mu.Unlock()

e.GET("/", h.GetIndex)
e.GET("/swagger/*", echoSwagger.WrapHandler)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this api?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swagger is used to serve API doc, so people can easily test APIs

api/server.go Outdated
e.POST("/delegate", h.Delegate)
e.POST("/vote", h.Vote)

e.GET("/stake", h.GetStake)
Copy link
Owner

@andrewsource147 andrewsource147 Dec 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please name api like smartcontract function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

api/server.go Outdated
e.GET("/delegateStake", h.GetDelegateStake)
e.GET("/representative", h.GetRepresentative)
e.GET("/reward", h.GetReward)
e.GET("/poolReward", h.GetPoolReward)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto^

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -0,0 +1,355 @@
definitions:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this files?

Copy link
Collaborator Author

@quangkeu95 quangkeu95 Dec 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated by Swagger, we can ignore it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants